#ifndef _CGAMECENTER_H_
#define _CGAMECENTER_H_

#include <string>

class CGameCenterManager
{
public:
    
   
    const static int                    MAX_ACHIEVEMENT = 10;
	static CGameCenterManager*			m_pInst;

	CGameCenterManager();
	
    
	static CGameCenterManager*			Instance();
        
    
    virtual std::string                 GetLeaderBoardName(); 
    virtual void                        OnGainAchievement(const char* ID);
    virtual void                        OnSuccessfulySubmitted(const char* ID);
    virtual void                        OnErrorSubmitted(const char* ID);
    virtual std::string					MapTypeToName(int Type);
    virtual void						OnRetrieveGainedAchivements(){};
    virtual void                        UpdateValue(int Type,
                                                    bool Success,
                                                    bool IsFinalDecision);
	
	int									MapNameToType(const std::string& TypeName);    
	void                                Init();
	void                                ShutDown();

    
	
	bool                                GetValue(int Type);
    
	bool                                IsAlradyGained(int Type);
	void                                ReportScore(int HighScore);
    
	void                                ShowAchievements();
	void                                ShowLeaderBoard();
    int                                 GetCompletedAchievementCount();

	
    
    void                                OnLogInSuccess(const wchar_t* PlayerName);
    void                                OnLogInError();
    

	   
protected:
    
    std::wstring                        m_PlayerName;
	bool                                m_bIsLogInSuccessful;

	virtual	void						Internal_LoginOnSuccess(const std::wstring& PlayerName){};
	virtual	void						Internal_LoginOnError(){};
    
    
private:


	

    bool                                m_IsCompelete[MAX_ACHIEVEMENT];
	bool                                m_CurrentValue[MAX_ACHIEVEMENT];
    
};

#endif